#include <iostream>
using namespace std;
// 素数对猜想 
// 算法复杂度 n^2
const int N = 100000;
//给第一个赋值为2，初始化质数列表
int all_number[N] = {2, 0};
int a[N];
int flag = 0;
int cont = 0;

int main(){
    int n;
    cin >> n;
    //生成2-n的所有整数
    for(int i = 0; i < n; ++i){
        all_number[i] = 2 + i;
    }
    // 伪埃氏筛法求素数数组
    for(int i = 1; i <= n; ++i){
        for(int j = 1; j <= i; ++j){
            // 避免前面出现0的情况
            if(all_number[j - 1] == 0) continue;
            else{
                if(all_number[i] % all_number[j - 1] == 0){
                    all_number[i] = 0;
                    break;
                }
            }
        }
        // cout << all_number[i-1] << endl;
        if(all_number[i-1] != 0){
            a[flag] = all_number[i-1];
            if(flag >=1 && a[flag] - a[flag-1] == 2){
                cont++;
            }
            flag++;
        }
    }
    cout << cont;
    return 0;
}